package cn.iocoder.yudao.module.kt.dal.mysql.ketangwatch;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.kt.dal.dataobject.ketangwatch.KetangWatchDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.kt.controller.admin.ketangwatch.vo.*;

/**
 * 数字人课堂观看记录 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface KetangWatchMapper extends BaseMapperX<KetangWatchDO> {

    default PageResult<KetangWatchDO> selectPage(KetangWatchPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<KetangWatchDO>()
                .likeIfPresent(KetangWatchDO::getName, reqVO.getName())
                .eqIfPresent(KetangWatchDO::getKetangId, reqVO.getKetangId())
                .eqIfPresent(KetangWatchDO::getUserId, reqVO.getUserId())
                .eqIfPresent(KetangWatchDO::getWatch, reqVO.getWatch())
                .betweenIfPresent(KetangWatchDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(KetangWatchDO::getId));
    }

}